const express = require('express')
const router = express.Router()

// 导入登录处理函数
const user_handler = require('../router_handler/user')

// 导入验证数据的中间件
const expressJoi = require('@escook/express-joi')
//导入需要的验证规则对象
const { login_schema, register_schema, authcode_schema } = require('../schema/user')
//登录
router.post('/login', expressJoi(login_schema), user_handler.logUser)
router.post('/register', expressJoi(register_schema), user_handler.regUser)
//验证码
router.post('/authcode', expressJoi(authcode_schema), user_handler.authCode)
module.exports = router